package com.h5lib.xlsx4j;

import java.io.IOException;
import java.io.StringWriter;

import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlPullParserFactory;
import org.xmlpull.v1.XmlSerializer;

public class MyXmlPullWrite {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		 try {
			XmlSerializer serializer = XmlPullParserFactory.newInstance().newSerializer();
			StringWriter writer = new StringWriter();
			serializer.setOutput(writer);
			serializer.startDocument("UTF-8", true);
			serializer.startTag(null, "my");
			serializer.text("hahhah");
			serializer.comment("xxx");
			serializer.startTag("", "cc");
			serializer.endDocument();
			System.out.println(writer.toString());
		 } catch (XmlPullParserException e) {
			e.printStackTrace();
		} catch (IllegalArgumentException e) {
			e.printStackTrace();
		} catch (IllegalStateException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

	}

}
